﻿@{
    ViewBag.Title = "登录";
}
<style type="text/css">
    .auth-msg {
        margin-top: 10px;
        padding: 8px 36px;
        font-size: 12px;
        line-height: 13px;
        color: #333;
        background: url(http://a.tbcdn.cn/sys/common/img/msg_bg.png) no-repeat
    }
    .auth-error {
        border: 1px solid #ffe1cc;
        background-position: 8px 6px;
        background-color: #fff2f2
    }
    .auth-success {
        background-position: 8px -245px;
        border: 1px solid #a4da2e;
        background-color: #f0ffe5
    }
    .auth-warn {
        background-position: 8px -145px;
        border: 1px solid #9bc9e8;
        background-color: #e6f1f9
    }
</style>
<script type="text/javascript">

        function tipShow() {
            $(".login-error").show();
        }

        function tipHide() {
            $(".login-error").hide();
        }

        function coderefresh() {
            var id = document.getElementById("imgverCode");
            var d = new Date();
            id.src = '/secure/verifyCode.jsp?a=' + d.getTime();
        }

        function hideVerifyCode() {
            $("#messagecode").hide();
        }

        function checkVerifyCode() {
            var tip = $("#tip");
            var vCode = document.getElementById("verifycode");
            if (vCode == null || vCode.value.length < 4) {
                tip.html("请输入验证码");
                tipShow();
                return false;
            } else {
                tipHide();
            }
            return true;
        }

        function chekNkNamefor() {
            var tip = $("#tip");
            
            var nkName = document.getElementById("userName").value;
            if (nkName == "" || nkName == null || nkName == "请输入用户名") {
                tip.html("请输入用户名");
                tipShow();
                return false;
            } else {
                tipHide();
                return true;
            }
        }

        function chekPwdfor_login() {
            var tip = $("#tip");
            var pwd = document.getElementById("password");
            if (pwd == null || pwd.value == "" || pwd.value == "请输入密码") {
                tip.html("请输入密码");
                tipShow();
                return false;
            } else {
                tipHide();
            }
            return true;
        }


        // 登录按钮操作
        function loginSubmit() {
            var tip = $("#tip");
            $("#loginerr").html("");
            var checkName = chekNkNamefor();
            var checkPwd = chekPwdfor_login();
            if (checkName && checkPwd) {
                return true;
            } else {
                return false;
            }
        }
    </script>
<div id="jm-touch" style="min-height: 80%;">
		<div id="jm-user-reg-form-c">
				<form id="jm-user-reg-form" method="post" action="@Url.Action("LogIn", "Account")" onsubmit="return loginSubmit();" novalidate>
						<input type="hidden" name="openId" id="openId">
				    <div style="margin-top: 50px;">
				        <div class="msg-wrapper" style="">
				            <p class="auth-msg auth-error login-error" style="display: none;">
				                <span id="tip">请输入用户名 </span>
				            </p>
				            @Html.ValidationSummary(true)
				        </div>
                         @Html.AntiForgeryToken()
				        <input type="text" placeholder="请输入用户名" jmuser="" class="first-child" onblur="chekNkNamefor();" id="userName" name="userName"/>
				    </div>
						<div>
						    <input id="password" type="password" placeholder="请输入密码" name="password" jmpwd="" onblur="chekPwdfor_login();"/>
						</div>
				    <div>
				        <button id="jm-submit-btn" type="submit" role="button" aria-disabled="false" tabindex="0" hidefocus="true" aria-pressed="false">登录</button>
				    </div>
                    <input type="text" style="display: none;" name="ReturnUrl" value="@ViewBag.returnUrl"/>
				    <div class="msg-wrapper" style="display: none;"></div>
				</form>
		    <div class="login-c"><span>没有账号?</span><a href="@Url.Action("Register","Account")">免费注册</a></div>
		</div>
</div>

